<div class="row" style="margin: 0px">
	<div class="col-sm-12 mt-3" style="border-bottom: 10px solid #f7f8f9;padding-bottom: 1rem;">
		<h4 style="text-align: center;color: #17a2b8;margin-bottom: 0;">审批管理</h4>
	</div>
</div>
<div class="row" style="margin-left: 0px; margin-right: 0px; background-color: white;">
	<div class="col-sm-3 mt-3">
		<div class="input-group input-group-sm">
			<div class="input-group-prepend">
				<div class="input-group-text">账外/账内</div>
			</div>
			<select class="form-control" x-ng-model="orderSearchObj.type_account">
				<option value="">请选择</option>
				<option value="OUT">账外</option>
				<option value="IN">账内</option>
			</select>
		</div>
	</div>
	<div class="col-sm-3 mt-3">
		<div class="input-group input-group-sm">
			<div class="input-group-prepend">
				<div class="input-group-text">出库/借出</div>
			</div>
			<select class="form-control" x-ng-model="orderSearchObj.type">
				<option value="">请选择</option>
				<option value="OUT">出库</option>
				<option value="BORROW">借出</option>
			</select>
		</div>
	</div>
	<div class="col-sm-4 mt-3">
		<div class="input-group input-group-sm">
			<div class="input-group-prepend">
				<div class="input-group-text">状态</div>
			</div>
			<select class="form-control" x-ng-model="orderSearchObj.approval_type_param">
				<option value="">请选择</option>
				<option value="DAI_SHE_NPI">待审批(该他审批的了)</option>
				<option value="SHEN_PI_ZHONG">审批中(不是他审批的)</option>
				<option value="YI_BO_HUI">已驳回</option>
				<option value="YI_TONG_GUO">已通过</option>
			</select>
		</div>
	</div>
	<div class="col-sm-12 mt-3 mb-3">
		<button x-ng-click="search()" title="搜索" type="button" class="btn btn-sm btn-outline-primary btn-block" style="display: block;width: 100%;margin: 2px;
			border-color: rgba(23,162,184,0.8);background-color: rgba(23,162,184,0.1) ;">
			<i class="fas fa-search" style="color: rgba(23,162,184,1)">&nbsp;搜索</i>
		</button>
	</div>
</div>
<div id="tableDemo" class="row" style="margin-left: 0px; margin-right: 0px; background-color: white;"></div>

<!-- 申领单查看 -->
<div class="modal" id="viewStoreModal" tabindex="-1">
	<div class="modal-dialog modal-dialog-centered">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title">申领单详情</h5>
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<div class="modal-body">
				<div class="row" style="margin-left: 0px; margin-right: 0px; background-color: white;">
					<table x-ng-repeat="viewRecord in orderRecordViewList" class="table table-sm table-hover table-bordered">
						<tbody>
						<tr>
							<td style="vertical-align: middle;width:20%">名称</td>
							<td style="vertical-align: middle;">{{viewRecord.name}}</td>
						</tr>
						<tr>
							<td style="vertical-align: middle;width:20%">CP号</td>
							<td style="vertical-align: middle;">{{viewRecord.sp_code}}</td>
						</tr>
						<tr>
							<td style="vertical-align: middle;">批次号</td>
							<td style="vertical-align: middle;">{{viewRecord.batch_code}}</td>
						</tr>
						<tr>
							<td style="vertical-align: middle;">类型</td>
							<td style="vertical-align: middle;">{{viewRecord.type | materielTypeFilter}}</td>
						</tr>
						<tr>
							<td style="vertical-align: middle;">数量</td>
							<td style="vertical-align: middle;">{{viewRecord.num}}</td>
						</tr>
						</tbody>
					</table>
				</div>
			</div>
			<div class="modal-header">
				<h5 class="modal-title">审批意见</h5>
			</div>
			<div class="modal-body">
				<div class="row" style="margin-left: 0px; margin-right: 0px; background-color: white;">
					<textarea class="form-control" x-ng-model="approval_msg"></textarea>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-sm btn-danger" x-ng-click="orderApproval('sprReject')">
					驳回
				</button>
				<button type="button" class="btn btn-sm btn-success" x-ng-click="orderApproval('sprAgree')">
					同意
				</button>
			</div>
		</div>
	</div>
</div>

<!-- 审批状态查看 -->
<div class="modal" id="viewApprovalModal" tabindex="-1">
	<div class="modal-dialog modal-dialog-centered">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title">审批状态</h5>
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<div class="modal-body">
				<div class="row" style="margin-left: 0px; margin-right: 0px; background-color: white;">
					<table x-ng-repeat="approvalLevel in approvalLevels" class="table table-sm table-hover table-bordered">
						<tbody>
							<tr>
								<td style="vertical-align: middle;width:20%">审批级别</td>
								<td style="vertical-align: middle;">{{approvalLevel.approval_name}}</td>
							</tr>
							<tr>
								<td style="vertical-align: middle;width:20%">所有审批人</td>
								<td style="vertical-align: middle;">
									<span x-ng-repeat="approvalLevelUser in approvalLevel.users">{{approvalLevelUser.name}}.&nbsp;&nbsp;</span>
								</td>
							</tr>
							<tr>
								<td style="vertical-align: middle;width:20%">已审批人</td>
								<td style="vertical-align: middle;">{{approvalMsg[$index].name}}</td>
							</tr>
							<tr>
								<td style="vertical-align: middle;width:20%">审批结果</td>
								<td style="vertical-align: middle;">
									{{approvalMsg[$index].type === 'AGREE' ? '同意' : ''}}
									{{approvalMsg[$index].type === 'REJECT' ? '驳回' : ''}}
								</td>
							</tr>
							<tr>
								<td style="vertical-align: middle;width:20%">审批消息</td>
								<td style="vertical-align: middle;">{{approvalMsg[$index].msg}}</td>
							</tr>
							<tr>
								<td style="vertical-align: middle;width:20%">审批时间</td>
								<td style="vertical-align: middle;">{{approvalMsg[$index].gmt_create}}</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
			<div class="modal-footer">
				<!-- <button type="button" class="btn btn-sm btn-default" data-dismiss="modal" aria-label="Close">
					<i class="fas fa-check"></i>
				</button> -->
			</div>
		</div>
	</div>
</div>